﻿

using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;

public class CustomWrapFile
{
    public static BindType[] binds = new BindType[]
   {
        _GT(typeof(TestClass))
   };

    public static BindType _GT(Type t)
    {
        return new BindType(t);
    }
    public static BindType[] GetBinds()
    {
        Assembly asm = Assembly.Load("Assembly-CSharp");
        Module[] modules = asm.GetModules();
        Type[] types = modules[0].FindTypes((type, obj) =>
            Attribute.GetCustomAttribute(type, typeof(LuaExport)) != null
        , null);
        List<BindType> list = new List<BindType>();
        foreach (Type type in types) {
            list.Add(_GT(type));
        }
        return list.ToArray();
    }
}

